{% extends 'base.html' %}
{% import '_macros.html' as macros %}

{% block title %}
{{ article.title }} - {{ BlogInfo.query.first().title }}
{% endblock %}

{% block content %}
<div id='article-detials' class="entry-box">
    {% include '_article_info.html' %}
    <hr>
    <div>
        <p>
            {{ article.content | safe }}
        </p>
    </div>
    <div class="article-add-info">
        <p>
            <span class="glyphicon glyphicon-time">
                博文最后更新时间：
            </span>
            {{ moment(article.update_time.replace(microsecond=0)).format('LLL') }}
        </p>
    </div>
    {% if current_user.is_authenticated %}
    <div class="article-edit">
        <a href="{{ url_for('admin.editArticles', id=article.id) }}">
            <button type="button" class="btn btn-default btn-sm">
                <span class="glyphicon glyphicon-pencil"></span>
                编辑
            </button>
        </a>
    </div>
    {% endif %}
    <hr>
    <h4 id="comments"><span class="glyphicon glyphicon-comment">评论</span></h4>
    {% include "_article_comments.html" %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, endpoint, id=id, fragment='#comments') }}
    </div>
    <h4 id="submit-comment"><span class="glyphicon glyphicon-comment">发表评论</span></h4>
    {% include "_submit_comment.html" %}
</div>
{% endblock %}

{% block stylesheet %}
{{ super() }}
<link href="{{ url_for('static', filename='css/prism.css') }}" rel="stylesheet">
{% endblock %}

{% block script %}
{{ super() }}
<script src="{{ url_for('static', filename='tinymce/js/tinymce/extentsion_self/codesimple_extentsion/prism.js') }}">
</script>
<script src="{{ url_for('static', filename='js/admin.js') }}"></script>
<script src="{{ url_for('static', filename='js/commentReply.js') }}"></script>
{% endblock %}
